package com.lijy.string;

import org.junit.Test;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.util.Scanner;

/**
 *
 */
public class ScannerTest {
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        //get first input
        System.out.println("what is your name?");
        String name = in.nextLine();

        //get second input
        System.out.println("How old are you?");
        int age = in.nextInt();

        //display output on concle
        System.out.println("Hello, " + name + ". Next year,you'll be " + (age + 1));
    }

    @Test
    public void scanner1() throws FileNotFoundException, UnsupportedEncodingException {
        Scanner in = new Scanner(new File("D:/SS/xn_fund_pay_statement_check_20003_20170516.txt"));
        while (in.hasNextLine()) {
            String src = in.nextLine();
            String t = new String(src.getBytes(),"utf-8");
            System.out.println(t);
        }
    }

}
